-
-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: guard against state-modifying expressions in range
expression
#3546
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #3546 +/- ##
==========================================
- Coverage 89.11% 86.68% -2.43%
==========================================
Files 85 85
Lines 11362 11369 +7
Branches 2584 2586 +2
==========================================
- Hits 10125 9855 -270
- Misses 816 1059 +243
- Partials 421 455 +34
... and 13 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
range
expressionrange
expression
vyper/semantics/analysis/local.py
Outdated
disallowed_builtins = ( | ||
"raw_call", | ||
"create_minimal_proxy_to", | ||
"create_copy_of", | ||
"create_from_blueprint", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better option is to add the is_modifying
attribute from member functions to builtins, which would allow us to check both member functions and builtin functions at the same time. Thoughts?
What I did
Fix #3504, fix #3172, closes #3188.
How I did it
Check for state modifying expressions in a range expression, and validate that no expression modifies state.
How to verify it
See new tests.
Commit message
Description for the changelog
Guard against state-modifying expressions in
range
expressionCute Animal Picture